package command;

import java.awt.CardLayout;

import javax.swing.JPanel;

import controller.GUIController;

public class NextPanel implements ICommand {
	
	JPanel content = null;
	CardLayout cl = null;	
	
	public NextPanel() {}
	
	public void goDebugScreen()
	{
		if(content == null || cl == null)
		{
			GUIController guicontroller = GUIController.getInstance();
			
			content = guicontroller.gui.getContentPanel();
			cl = guicontroller.gui.getCardLayout();
		}
		
		cl.show(content, "DEBUG");
	}
	
	public void goHome()
	{
		if(content == null || cl == null)
		{
			GUIController guicontroller = GUIController.getInstance();
			
			content = guicontroller.gui.getContentPanel();
			cl = guicontroller.gui.getCardLayout();
		}
		
		cl.show(content, "HOME");
	}
	
	public void goChatScreen()
	{
		if(content == null || cl == null)
		{
			GUIController guicontroller = GUIController.getInstance();
			
			content = guicontroller.gui.getContentPanel();
			cl = guicontroller.gui.getCardLayout();
		}
		
		cl.show(content, "CHAT");
	}
	
	public void execute()
	{
		if(content == null || cl == null)
		{
			GUIController guicontroller = GUIController.getInstance();
			
			content = guicontroller.gui.getContentPanel();
			cl = guicontroller.gui.getCardLayout();
		}
		
		cl.next(content);
	}
}

